<?php
class NewsModel extends Model{
	public $table ='news';
	public $validate=array(
		array('code','nonull','验证码不能为空',2,3),
		array('code','checkCode','验证码输入错误',2,3),
	);
	//验证码验证
	public function checkCode($name, $value, $msg, $arg){
		if(strtoupper($value)==$_SESSION['code']){
			return true;
		}else{
			return $msg;
		}
	}
}